package twelfth.转换流OutputStream类与InputStream类;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class OutputStreamWriter {
    public static void main(String[] args) throws IOException {

        String path= "D:" + File.separator + "WorkSpaces" + File.separator +
                "JavaDevelopBase_start_329" + File.separator + "src" + File.separator +
                "twelfth" + File.separator + "demo3.txt";
        File file = new File(path);
        Writer w = new java.io.OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);  //字符流变为字节流
        w.write("hello,王境泽！");
        w.close();
    }
}
